<!DOCTYPE html>
<html>
<head>
	<meta charset="utf-8">
	<meta name="viewport" content="width=device-width, initial-scale=1">
	<title></title>
	<link rel="stylesheet" type="text/css" href="css/cases2.css">
</head>
<body>
	<div class="bannerS">
		
		<!-- 导航栏 -->
	<div class="nav ">
		<div class="banner">
			<img src="https://www.buchouwang.com/img/logo.a2dacc49.png">
		</div>
		<div class="nav-center">
			<a href="./index.html" class="item-on">首页 <span></span></a>
			<a href="./po.html" class="product">产品介绍 <span></span>
				<div class="Invisibility">
				<div class="subnav"></div>
			</div>
			</a>
			
			<a href="">解决方案 <span></span></a>
			<a href="">案例展示 <span></span></a>
			<a href="">新闻中心 
				<span></span>
				
			</a>
			<a href="">关于我们 <span></span></a>
			<a href="">加入我们 
				<span></span>
			</a>
			<a href="">生猪交易 <span></span></a>
			<a href="">申请演示 <span></span></a>
		</div>
        	
	</div>
	<div class="bantie">
			<div class="bancon">
				<div class="banner-title">案例展示</div>
				<div class="banner-info">案例展示</div>
			</div>
		</div>
	</div>
	<div class="detail-wrap">
		<div class="center-wrap">
			<div class="content">
				<div class="contentPage">
					<span>首页 > 案例展示 > </span>
					<span>案例展示详情页</span>
				</div>
				<div class="detail-content-wrap clearfix">
					
				</div>
			</div>
		</div>
	</div>
	<script type="text/javascript" src="ajax.js"></script>
	<script type="text/javascript" src="jquery-3.2.1.js"></script>
	<script type="text/javascript">
		console.log(location.href)
		let id = location.href.split('=')[1];



			//二级导航
			let subnav = document.querySelector(".subnav")
			ajax({
			  method: "get",
			  url: "stage-api/website/getProductMenuInfo",
			}).then(res => {
			  for(let i = 0; i < res.data.length; i++){
			    if (i == 4) {
			      continue;
			    }else if(i == 6){
			      continue;
			    }else{
			      subnav.innerHTML += `<div class="subtag" onclick=detail('${res.data[i].productId}')>
			                            <img src=${res.data[i].menuIcon.split("?")[0]}>
			                            <p>${res.data[i].productName}</p >
			                            </div>`
			    }
			  }
			})

			  function detail(productId){
			    location.href = `po.html?productId=${productId}`
			  }
			  $(".product").hover(function(){
				  $(".Invisibility").css("display", "block")
				}, function(){
				  $(".Invisibility").css("display", "none")
				})


			// 渲染下页面
			  let ComId = location.href.split("?")[1].split("=")[1]
			 let list = document.querySelector(".detail-content-wrap")
			 ajax({
			 	method:"get",
			 	url: "stage-api/website/getCompanyDetails",
			 	params:{
			 		caseCompanyId: ComId,
			 	},
			 })
			 .then( res => {
			 	console.log(res)
			 	list.innerHTML += `<div class="content-left">
						<div class="content-left-title">
							${res.data.caseCompanyName}
						</div>
						<div class="content-left-text"> 
							${res.data.caseCompanyIntroduce}
						</div>
					</div>`
			 })
	</script>
</body>
</html>